package dk.isten.andro.julesangbog;

import com.google.ads.AdRequest;
import com.google.ads.AdSize;
import com.google.ads.AdView;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.Toast;

public class Front_act extends Activity implements OnClickListener{

	  private AdView adView;
	  ImageView evangelist, sange;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_front_act);
        
        adView = new AdView(this,AdSize.BANNER,"a150c885400968e");
        LinearLayout ll= (LinearLayout) findViewById(R.id.adView);
        ll.addView(adView);
        
        AdRequest ar = new AdRequest();
//        ar.addTestDevice(AdRequest.TEST_EMULATOR);
        adView.loadAd(ar);
        
        evangelist = (ImageView) findViewById(R.id.evangelist);
        sange = (ImageView) findViewById(R.id.sange);

        evangelist.setOnClickListener(this);
        sange.setOnClickListener(this);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_front_act, menu);
        return true;
    }
    
	  // Called every time user clicks on a menu item
	  @Override
	  public boolean onOptionsItemSelected(MenuItem item)
	  { 
		  switch (item.getItemId()) 
		  {
		  		case R.id.support:
		  			startActivity(new Intent(this, SupportActivity.class));
		  			break;
		  }  
		  
		  return true;
	  }

	@Override
	public void onClick(View v) {

if(v==evangelist){
            
        	Intent i = new Intent(this, Evangelium_Act.class);
                             startActivity(i);
                    
        }else if(v==sange){

                	Intent i = new Intent(this, Sang_List_Act.class);
                            startActivity(i);
                            
                }
	}
}
